function doBrandWork(masterComboId, detailComboId)
{
	
	httpObject = getHTTPObject();
  	if (httpObject != null) {
  		var parentCombo = document.getElementById(masterComboId);
  		if (parentCombo) {
  		    if (detailComboId) {
  		        var url = "../../../Ajax/BrandMasterDetailAjax.aspx?masterItemId=" + parentCombo.value;
  			    httpObject.open("GET", url, true);
  				httpObject.onreadystatechange = function() 
  				{
  					if (httpObject.readyState == 4) {
  						var combo = document.getElementById(detailComboId);
  						if (combo != null) {
  							combo.options.length = 0;
  							var response = httpObject.responseText;
  							var items = response.split(";");
  							var count = items.length;
  							for (var i = 0; i < count; i++){
  								var options = items[i].split(",");
  								if (options[0] != "")
  								    combo.options[i] = new Option(options[0], options[1]);
  							}	//for
  							showHideBrandCombo(detailComboId);
  						}	//if
  					}	//if state
  				}	//func
  				httpObject.send(null);
  			}	//if
  		}	//if
  	}	//if
}

function clearBrandCombo(comboId)
{
	if (comboId) {
		var comboToClear = document.getElementById(comboId);
		if (comboToClear) {
			comboToClear.options.length = 0;
			comboToClear.options[0] = new Option("---", -1);
		}	//if
	}	//if
}

function showHideBrandCombo(comboId)
{
	if (comboId) {
		var item = document.getElementById('div' + comboId);
		if (item) {
			var comboToShowHide = document.getElementById(comboId);
			if (comboToShowHide) {
				if (comboToShowHide.options) {
					if (comboToShowHide.options.length <= 1) {
						item.style.display = 'none';
					} else {	//if
						item.style.display = 'block';					
					}	//else
				}	//if
			}	//if
		}	//if
	}	//if
};